import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Pulpos here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Pulpos extends Enemigos
{
    /**
     * Act - do whatever the Pulpos wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
      private GreenfootImage pulpo1=new GreenfootImage("pulpo1.png");
      private GreenfootImage pulpo2=new GreenfootImage("pulpo2.png");
      private GreenfootImage pulpo3=new GreenfootImage("pulpo3.png");
      private int numero;
  
      public void act() 
    {
        // Add your action code here.
        this.move(1);
        movimiento();
        if(resistencia>=1){
            getWorld().addObject(new Comida(),getX(),getY());   
            getWorld().removeObject(this);
        }
    }
    public Pulpos(){
    numero=0;
    setImage(pulpo2);   
    resistencia=0;
    }
    public void movimiento(){
        numero++;
    if(numero==10){setImage(pulpo1);}
    if(numero==20){setImage(pulpo2);}
    if(numero==30){setImage(pulpo3);numero=0;}
    
    }
   
    
}
